package cn.ibizlab.odoo.core.odoo_mrp.service.impl;

import java.io.Serializable;
import java.sql.Timestamp;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.HashMap;
import java.math.BigInteger;
import java.util.Collection;

import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cglib.beans.BeanCopier;
import org.springframework.stereotype.Service;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageImpl;
import org.springframework.data.domain.Pageable;
import cn.ibizlab.odoo.core.client.model.Imrp_unbuild;
import cn.ibizlab.odoo.core.odoo_mrp.domain.Mrp_unbuild;
import cn.ibizlab.odoo.core.odoo_mrp.filter.Mrp_unbuildSearchContext;
import cn.ibizlab.odoo.core.odoo_mrp.service.IMrp_unbuildService;
import cn.ibizlab.odoo.util.SearchResult;
import cn.ibizlab.odoo.util.log.IBIZLog;

/**
 * 实体[拆解单] 服务对象接口实现
 */
@Slf4j
@IBIZLog
@Service
public class Mrp_unbuildServiceImpl implements IMrp_unbuildService {

    @Autowired
    private cn.ibizlab.odoo.core.client.service.Imrp_unbuildClientService mrp_unbuildClientService;

    @Override
    public boolean update(Mrp_unbuild mrp_unbuild) {
        boolean bOk = false ;
        Imrp_unbuild clientModel = this.convert2Model(mrp_unbuild,null);
        mrp_unbuildClientService.update(clientModel) ;
        this.convert2Domain(clientModel,mrp_unbuild) ;
        bOk = true;
        return bOk ;
    }

    @Override
    public void removeBatch(Collection<? extends Serializable> idList, int batchSize) {

        //mrp_unbuildClientService.removeBatch(mrp_unbuilds) ;

    }

    @Override
    public boolean remove(Integer id) {
        boolean bOk = false ;
        Imrp_unbuild clientModel = mrp_unbuildClientService.createModel();
        clientModel.setId(id);
        mrp_unbuildClientService.remove(clientModel) ;
        bOk = true ;
        return bOk ;
    }

    @Override
    public Mrp_unbuild get(Integer id) {
        Imrp_unbuild clientModel = mrp_unbuildClientService.createModel();
        clientModel.setId(id);
        mrp_unbuildClientService.get(clientModel) ;
        return this.convert2Domain(clientModel,null);
    }

    @Override
    public Mrp_unbuild get(Mrp_unbuild mrp_unbuild) {
        Mrp_unbuild retmrp_unbuild = this.get(mrp_unbuild.getId()) ;
    	BeanCopier copier=BeanCopier.create(retmrp_unbuild.getClass(), mrp_unbuild.getClass(), false);
        copier.copy(retmrp_unbuild, mrp_unbuild, null);
        return mrp_unbuild ;
    }

    @Override
    public void createBatch(List<Mrp_unbuild> mrp_unbuilds, int batchSize) {

                        //mrp_unbuildClientService.createBatch(mrp_unbuilds,batchSize) ;

    }

    @Override
    public void updateBatch(List<Mrp_unbuild> mrp_unbuilds, int batchSize) {

        //mrp_unbuildClientService.updateBatch(mrp_unbuilds,batchSize) ;

    }

    @Override
    public boolean create(Mrp_unbuild mrp_unbuild) {
        boolean bOk = false ;
        Imrp_unbuild clientModel = this.convert2Model(mrp_unbuild,null);
        mrp_unbuildClientService.create(clientModel) ;
        this.convert2Domain(clientModel,mrp_unbuild);
        bOk = true ;

        return bOk ;
    }

    /**
     * 查询集合 默认查询
     */
    @Override
    public Page<Mrp_unbuild> searchDefault(Mrp_unbuildSearchContext context) {
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());
    }


    /**
     * 根据物料清单查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_bom(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据Production Order查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_mo(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据产品查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_product(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_create(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据用户查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_write(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_location_dest(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据库存位置查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_location(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据批次/序列号查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_lot(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }

    /**
     * 根据产品计量单位查询
     */
    @Override
    public Page<Mrp_unbuild> selectByOdoo_product_uom(Integer id){
        Mrp_unbuildSearchContext context = new Mrp_unbuildSearchContext();
        if(!org.springframework.util.StringUtils.isEmpty(id)){
            cn.ibizlab.odoo.util.SearchFieldFilter fieldFilter=new cn.ibizlab.odoo.util.SearchFieldFilter();
            fieldFilter.setParam("id");
            fieldFilter.setCondition(cn.ibizlab.odoo.util.enums.SearchFieldType.EQ);
            fieldFilter.setValue(id);
            context.getCondition().add(fieldFilter);
        }
        List<Mrp_unbuild> list = new ArrayList<Mrp_unbuild>();
        Page<cn.ibizlab.odoo.core.client.model.Imrp_unbuild> clientModelList = mrp_unbuildClientService.search(context) ;
        for(cn.ibizlab.odoo.core.client.model.Imrp_unbuild clientModel : clientModelList){
            list.add( this.convert2Domain(clientModel,null));
        }
        return new PageImpl<Mrp_unbuild>(list, context.getPageable(), clientModelList.getTotalElements());

    }



    public Imrp_unbuild convert2Model(Mrp_unbuild domain , Imrp_unbuild model) {
        if(domain == null)
            return model ;
        if(model==null){
            model = mrp_unbuildClientService.createModel() ;
        }

         if(domain.getMessage_has_error_counterDirtyFlag())
            model.setMessage_has_error_counter(domain.getMessage_has_error_counter());
         if(domain.getMessage_unread_counterDirtyFlag())
            model.setMessage_unread_counter(domain.getMessage_unread_counter());
         if(domain.getProduct_qtyDirtyFlag())
            model.setProduct_qty(domain.getProduct_qty());
         if(domain.getWebsite_message_idsDirtyFlag())
            model.setWebsite_message_ids(domain.getWebsite_message_ids());
         if(domain.getMessage_is_followerDirtyFlag())
            model.setMessage_is_follower(domain.getMessage_is_follower());
         if(domain.getActivity_summaryDirtyFlag())
            model.setActivity_summary(domain.getActivity_summary());
         if(domain.getActivity_stateDirtyFlag())
            model.setActivity_state(domain.getActivity_state());
         if(domain.getConsume_line_idsDirtyFlag())
            model.setConsume_line_ids(domain.getConsume_line_ids());
         if(domain.getActivity_type_idDirtyFlag())
            model.setActivity_type_id(domain.getActivity_type_id());
         if(domain.getActivity_date_deadlineDirtyFlag())
            model.setActivity_date_deadline(domain.getActivity_date_deadline());
         if(domain.getMessage_main_attachment_idDirtyFlag())
            model.setMessage_main_attachment_id(domain.getMessage_main_attachment_id());
         if(domain.getActivity_user_idDirtyFlag())
            model.setActivity_user_id(domain.getActivity_user_id());
         if(domain.getWrite_dateDirtyFlag())
            model.setWrite_date(domain.getWrite_date());
         if(domain.getProduce_line_idsDirtyFlag())
            model.setProduce_line_ids(domain.getProduce_line_ids());
         if(domain.getMessage_needaction_counterDirtyFlag())
            model.setMessage_needaction_counter(domain.getMessage_needaction_counter());
         if(domain.getStateDirtyFlag())
            model.setState(domain.getState());
         if(domain.getMessage_unreadDirtyFlag())
            model.setMessage_unread(domain.getMessage_unread());
         if(domain.get__last_updateDirtyFlag())
            model.set__last_update(domain.get__last_update());
         if(domain.getMessage_partner_idsDirtyFlag())
            model.setMessage_partner_ids(domain.getMessage_partner_ids());
         if(domain.getCreate_dateDirtyFlag())
            model.setCreate_date(domain.getCreate_date());
         if(domain.getMessage_idsDirtyFlag())
            model.setMessage_ids(domain.getMessage_ids());
         if(domain.getMessage_follower_idsDirtyFlag())
            model.setMessage_follower_ids(domain.getMessage_follower_ids());
         if(domain.getMessage_channel_idsDirtyFlag())
            model.setMessage_channel_ids(domain.getMessage_channel_ids());
         if(domain.getIdDirtyFlag())
            model.setId(domain.getId());
         if(domain.getDisplay_nameDirtyFlag())
            model.setDisplay_name(domain.getDisplay_name());
         if(domain.getMessage_has_errorDirtyFlag())
            model.setMessage_has_error(domain.getMessage_has_error());
         if(domain.getMessage_needactionDirtyFlag())
            model.setMessage_needaction(domain.getMessage_needaction());
         if(domain.getNameDirtyFlag())
            model.setName(domain.getName());
         if(domain.getMessage_attachment_countDirtyFlag())
            model.setMessage_attachment_count(domain.getMessage_attachment_count());
         if(domain.getActivity_idsDirtyFlag())
            model.setActivity_ids(domain.getActivity_ids());
         if(domain.getWrite_uid_textDirtyFlag())
            model.setWrite_uid_text(domain.getWrite_uid_text());
         if(domain.getProduct_id_textDirtyFlag())
            model.setProduct_id_text(domain.getProduct_id_text());
         if(domain.getCreate_uid_textDirtyFlag())
            model.setCreate_uid_text(domain.getCreate_uid_text());
         if(domain.getMo_id_textDirtyFlag())
            model.setMo_id_text(domain.getMo_id_text());
         if(domain.getLocation_id_textDirtyFlag())
            model.setLocation_id_text(domain.getLocation_id_text());
         if(domain.getLocation_dest_id_textDirtyFlag())
            model.setLocation_dest_id_text(domain.getLocation_dest_id_text());
         if(domain.getProduct_uom_id_textDirtyFlag())
            model.setProduct_uom_id_text(domain.getProduct_uom_id_text());
         if(domain.getLot_id_textDirtyFlag())
            model.setLot_id_text(domain.getLot_id_text());
         if(domain.getHas_trackingDirtyFlag())
            model.setHas_tracking(domain.getHas_tracking());
         if(domain.getProduct_uom_idDirtyFlag())
            model.setProduct_uom_id(domain.getProduct_uom_id());
         if(domain.getBom_idDirtyFlag())
            model.setBom_id(domain.getBom_id());
         if(domain.getMo_idDirtyFlag())
            model.setMo_id(domain.getMo_id());
         if(domain.getWrite_uidDirtyFlag())
            model.setWrite_uid(domain.getWrite_uid());
         if(domain.getCreate_uidDirtyFlag())
            model.setCreate_uid(domain.getCreate_uid());
         if(domain.getLot_idDirtyFlag())
            model.setLot_id(domain.getLot_id());
         if(domain.getLocation_idDirtyFlag())
            model.setLocation_id(domain.getLocation_id());
         if(domain.getProduct_idDirtyFlag())
            model.setProduct_id(domain.getProduct_id());
         if(domain.getLocation_dest_idDirtyFlag())
            model.setLocation_dest_id(domain.getLocation_dest_id());
        return model ;
    }

    public Mrp_unbuild convert2Domain( Imrp_unbuild model ,Mrp_unbuild domain) {
        if(model == null)
            return domain ;
        if(domain == null){
            domain = new Mrp_unbuild();
        }

        if(model.getMessage_has_error_counterDirtyFlag())
            domain.setMessage_has_error_counter(model.getMessage_has_error_counter());
        if(model.getMessage_unread_counterDirtyFlag())
            domain.setMessage_unread_counter(model.getMessage_unread_counter());
        if(model.getProduct_qtyDirtyFlag())
            domain.setProduct_qty(model.getProduct_qty());
        if(model.getWebsite_message_idsDirtyFlag())
            domain.setWebsite_message_ids(model.getWebsite_message_ids());
        if(model.getMessage_is_followerDirtyFlag())
            domain.setMessage_is_follower(model.getMessage_is_follower());
        if(model.getActivity_summaryDirtyFlag())
            domain.setActivity_summary(model.getActivity_summary());
        if(model.getActivity_stateDirtyFlag())
            domain.setActivity_state(model.getActivity_state());
        if(model.getConsume_line_idsDirtyFlag())
            domain.setConsume_line_ids(model.getConsume_line_ids());
        if(model.getActivity_type_idDirtyFlag())
            domain.setActivity_type_id(model.getActivity_type_id());
        if(model.getActivity_date_deadlineDirtyFlag())
            domain.setActivity_date_deadline(model.getActivity_date_deadline());
        if(model.getMessage_main_attachment_idDirtyFlag())
            domain.setMessage_main_attachment_id(model.getMessage_main_attachment_id());
        if(model.getActivity_user_idDirtyFlag())
            domain.setActivity_user_id(model.getActivity_user_id());
        if(model.getWrite_dateDirtyFlag())
            domain.setWrite_date(model.getWrite_date());
        if(model.getProduce_line_idsDirtyFlag())
            domain.setProduce_line_ids(model.getProduce_line_ids());
        if(model.getMessage_needaction_counterDirtyFlag())
            domain.setMessage_needaction_counter(model.getMessage_needaction_counter());
        if(model.getStateDirtyFlag())
            domain.setState(model.getState());
        if(model.getMessage_unreadDirtyFlag())
            domain.setMessage_unread(model.getMessage_unread());
        if(model.get__last_updateDirtyFlag())
            domain.set__last_update(model.get__last_update());
        if(model.getMessage_partner_idsDirtyFlag())
            domain.setMessage_partner_ids(model.getMessage_partner_ids());
        if(model.getCreate_dateDirtyFlag())
            domain.setCreate_date(model.getCreate_date());
        if(model.getMessage_idsDirtyFlag())
            domain.setMessage_ids(model.getMessage_ids());
        if(model.getMessage_follower_idsDirtyFlag())
            domain.setMessage_follower_ids(model.getMessage_follower_ids());
        if(model.getMessage_channel_idsDirtyFlag())
            domain.setMessage_channel_ids(model.getMessage_channel_ids());
        if(model.getIdDirtyFlag())
            domain.setId(model.getId());
        if(model.getDisplay_nameDirtyFlag())
            domain.setDisplay_name(model.getDisplay_name());
        if(model.getMessage_has_errorDirtyFlag())
            domain.setMessage_has_error(model.getMessage_has_error());
        if(model.getMessage_needactionDirtyFlag())
            domain.setMessage_needaction(model.getMessage_needaction());
        if(model.getNameDirtyFlag())
            domain.setName(model.getName());
        if(model.getMessage_attachment_countDirtyFlag())
            domain.setMessage_attachment_count(model.getMessage_attachment_count());
        if(model.getActivity_idsDirtyFlag())
            domain.setActivity_ids(model.getActivity_ids());
        if(model.getWrite_uid_textDirtyFlag())
            domain.setWrite_uid_text(model.getWrite_uid_text());
        if(model.getProduct_id_textDirtyFlag())
            domain.setProduct_id_text(model.getProduct_id_text());
        if(model.getCreate_uid_textDirtyFlag())
            domain.setCreate_uid_text(model.getCreate_uid_text());
        if(model.getMo_id_textDirtyFlag())
            domain.setMo_id_text(model.getMo_id_text());
        if(model.getLocation_id_textDirtyFlag())
            domain.setLocation_id_text(model.getLocation_id_text());
        if(model.getLocation_dest_id_textDirtyFlag())
            domain.setLocation_dest_id_text(model.getLocation_dest_id_text());
        if(model.getProduct_uom_id_textDirtyFlag())
            domain.setProduct_uom_id_text(model.getProduct_uom_id_text());
        if(model.getLot_id_textDirtyFlag())
            domain.setLot_id_text(model.getLot_id_text());
        if(model.getHas_trackingDirtyFlag())
            domain.setHas_tracking(model.getHas_tracking());
        if(model.getProduct_uom_idDirtyFlag())
            domain.setProduct_uom_id(model.getProduct_uom_id());
        if(model.getBom_idDirtyFlag())
            domain.setBom_id(model.getBom_id());
        if(model.getMo_idDirtyFlag())
            domain.setMo_id(model.getMo_id());
        if(model.getWrite_uidDirtyFlag())
            domain.setWrite_uid(model.getWrite_uid());
        if(model.getCreate_uidDirtyFlag())
            domain.setCreate_uid(model.getCreate_uid());
        if(model.getLot_idDirtyFlag())
            domain.setLot_id(model.getLot_id());
        if(model.getLocation_idDirtyFlag())
            domain.setLocation_id(model.getLocation_id());
        if(model.getProduct_idDirtyFlag())
            domain.setProduct_id(model.getProduct_id());
        if(model.getLocation_dest_idDirtyFlag())
            domain.setLocation_dest_id(model.getLocation_dest_id());
        return domain ;
    }


}
